package scorer;

import java.util.ArrayList;

import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;

import tile.Bamboo;
import tile.Character;
import tile.Dots;
import tile.Dragon;
import tile.Tile;
import tile.Wind;
import tile.Tile.SUIT;


public class ScorerMain {

	static ArrayList<Tile> tiles;

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		tiles = new ArrayList<Tile>();

		try {
			for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
			ScorerFrame f = new ScorerFrame();
			f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			f.setVisible(true);

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	public static void generateTiles(ArrayList<Tile> tiles, int howMany)
			throws Exception {
		for (Object o : Character.getValidValues()) {
			for (int i = 0; i < howMany; i++) {
				tiles.add(new Character(o, SUIT.character));
			}
		}
		for (Object o : Dots.getValidValues()) {
			for (int i = 0; i < howMany; i++) {
				tiles.add(new Dots(o, SUIT.dots));
			}
		}
		for (Object o : Bamboo.getValidValues()) {
			for (int i = 0; i < howMany; i++) {
				tiles.add(new Bamboo(o, SUIT.bamboo));
			}
		}
		for (Object o : Wind.getValidValues()) {
			for (int i = 0; i < howMany; i++) {
				tiles.add(new Wind(o, SUIT.Wind));
			}
		}
		for (Object o : Dragon.getValidValues()) {
			for (int i = 0; i < howMany; i++) {
				tiles.add(new Dragon(o, SUIT.Dragon));
			}
		}
		;
	}

}
